package com.app.micaihu.bean.topic;

import android.text.TextUtils;

import com.app.micaihu.bean.comment.PariseBean;
import com.app.micaihu.bean.news.ShareBean;
import com.app.micaihu.configure.TypeConstant;

import java.io.Serializable;
import java.util.List;

/**
 * Created by Guo on 2016/9/8.
 *
 *
 *
 * 帖子 的bean类，作为话题详情和帖子详情中的bean类
 */
public class PostBean extends ShareBean implements Serializable {

    private String id;//留言Id
    private String uid;//留言用户uid
    private String topicId;//话题id
    private String title;//话题标题
    private String nickName;//用户昵称
    private String rankIcon;
    private String rankName;
    private String content;//留言文字
    private List<String> imgList;//留言图片
    private String praiseNum;//点赞数
    private String replyNum;
    private String publishTime;
    private String headPic;
    private List<PostBean> childList;//帖子留言的集合
    private String parentCmtId;//父评论的id
    private String type;//0对话题的留言 1对一级留言回复,暂时无用
    private String ctype;//帖子类型；1：正常帖子；其他暂时隐藏
    private String tansImg;//当前用户发帖能够穿图片；1：能；0：不能；

    //2.0.2新增字段-关注状态
    private String status;//关注状态；关注状态 0未关注 1已关注 2互相关注
    private String postTypeName;//当前条目的name，用来区分Adapter 中的type
    private String pNickName;//父评论用户昵称
    private String pUid;//父评论用户id

    private String articleType;//稿子类型
    private String thumb;//作为帖子详情中 的缩略图
//    private PostCommentChildBean postCommentChildBean;

    private String childNum;//子评论的数量
    private String commentTypeName;


    private String isFans;//是否是粉丝1是 0否

    private List<PariseBean> praiseList;//点赞集合


    public List<PariseBean> getPraiseList() {
        return praiseList;
    }

    public void setPraiseList(List<PariseBean> praiseList) {
        this.praiseList = praiseList;
    }



    public boolean getIsFans() {
        return TextUtils.equals("1",isFans);
    }

    public void setIsFans(String isFans) {
        this.isFans = isFans;
    }

    public String getCommentTypeName() {
        return commentTypeName;
    }

    public String getChildNum() {
        return childNum;
    }

    public void setChildNum(String childNum) {
        this.childNum = childNum;
    }

    public String getReplyType(){
        //2级子评论的返回@
        if(TextUtils.equals(type, TypeConstant.COMMENT_TWO)){
            return "@";
        }
        return "";
    }


    public String getThumb() {
        return thumb;
    }

    public void setThumb(String thumb) {
        this.thumb = thumb;
    }

    public String getArticleType() {
        return articleType;
    }

    public void setArticleType(String articleType) {
        this.articleType = articleType;
    }

    public String getpNickName() {
        return pNickName;
    }

    public void setpNickName(String pNickName) {
        this.pNickName = pNickName;
    }

    public String getpUid() {
        return pUid;
    }

    public void setpUid(String pUid) {
        this.pUid = pUid;
    }

    public String getPostTypeName() {
        return postTypeName;
    }

    public void setPostTypeName(String postTypeName) {
        this.postTypeName = postTypeName;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public PostBean(){
        //默认分享类型为帖子类型
        this.shareType = TypeConstant.SHARE_TYPE_POST;
    }


    public String getParentCmtId() {
        return TextUtils.isEmpty(parentCmtId) ? "0" :parentCmtId;
    }

    public void setParentCmtId(String parentCmtId) {
        this.parentCmtId = parentCmtId;
    }

    public List<PostBean> getChildList() {
        return childList;
    }

    public void setChildList(List<PostBean> childList) {
        this.childList = childList;
    }


    //private List<PostCommentBean> childList;//帖子留言的集合


    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getCtype() {
        return TextUtils.isEmpty(ctype) ? "1" : ctype;
    }

    public void setCtype(String ctype) {
        this.ctype = ctype;
    }

    public String getTansImg() {
        return tansImg;
    }

    public void setTansImg(String tansImg) {
        this.tansImg = tansImg;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getTopicId() {
        return topicId;
    }

    public void setTopicId(String topicId) {
        this.topicId = topicId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getRankIcon() {
        return rankIcon;
    }

    public void setRankIcon(String rankIcon) {
        this.rankIcon = rankIcon;
    }

    public String getRankName() {
        return rankName;
    }

    public void setRankName(String rankName) {
        this.rankName = rankName;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public List<String> getImgList() {
        return imgList;
    }

    public void setImgList(List<String> imgList) {
        this.imgList = imgList;
    }

    public String getPraiseNum() {
        if(TextUtils.isEmpty(praiseNum)){
            praiseNum = "0";
        }
        return praiseNum;
    }

    public void setPraiseNum(String praiseNum) {
        this.praiseNum = praiseNum;
    }

    public String getReplyNum() {
        if(TextUtils.isEmpty(replyNum)){
            replyNum = "0";
        }
        return replyNum;
    }

    public void setReplyNum(String replyNum) {
        this.replyNum = replyNum;
    }

    public String getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(String publishTime) {
        this.publishTime = publishTime;
    }

    public String getHeadPic() {
        return headPic;
    }

    public void setHeadPic(String headPic) {
        this.headPic = headPic;
    }

    public void setCommentTypeName(String commentTypeName) {

        this.commentTypeName = commentTypeName;
    }

    /*public List<PostCommentBean> getChildList() {
        return childList;
    }

    public void setChildList(List<PostCommentBean> childList) {
        this.childList = childList;
    }*/





    /*public PostCommentChildBean toPostCommentChildBean(PostBean postBean){
        if(postCommentChildBean == null){
            postCommentChildBean = new PostCommentChildBean();

        }
        postCommentChildBean.setId(postBean.getId());
        postCommentChildBean.setType(postBean.getType());
        postCommentChildBean.setNickName(postBean.getNickName());
        postCommentChildBean.setContent(postBean.getContent());
        postCommentChildBean.setPublishTime(postBean.getPublishTime());
        postCommentChildBean.setTopicId(postBean.getTopicId());
        postCommentChildBean.setUid(postBean.getUid());
        postCommentChildBean.setpNickName(postBean.getpNickName());

        return postCommentChildBean;
    }*/
}
